package com.campus.app.mapper;

import com.campus.commons.entity.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 菜单表 Mapper 接口
 * </p>
 *
 * @author Rin
 * @since 2020-12-24
 */
@Mapper
@Repository
public interface MenuMapper extends BaseMapper<Menu> {
    /**
     * 获取搜有权限
     *
     * @return
     */
    @Select("select * from v_menu_pn")
    List<Menu> getMenuAll();

    /**
     * 根据用户查找权限
     *
     * @param
     * @return
     */
    @Select("select * from v_menu_pn where userId=#{userId}")
    List<Menu> selectUserAuthorities(long userId);
}
